package com.ledijiaoyu.autogate.packet.request;

import com.ledijiaoyu.autogate.base.AutoGateCommand;
import com.ledijiaoyu.autogate.base.AutoGatePacket;

/**
 * Create with Android Studio
 * Author: chengpengfei
 * Date: 2018/5/22
 * Time: 5:57 PM
 * Description:读取一条刷卡数据
 */
public class ReadCreditCardInfoPacket extends AutoGatePacket{

    /**
     * 构造器
     * @param infoId    刷卡数据记录 Id
     */
    public ReadCreditCardInfoPacket(int infoId) {

        String cardInfo = String.format("0000%d",infoId);
        int index = cardInfo.length() - 5;
        cardInfo = cardInfo.substring(index);
        char[] t_card = cardInfo.toCharArray();
        for(int i = 0;i < t_card.length;i++){
            argus.add(String.valueOf(t_card[i]));
        }

        setCommand(AutoGateCommand.READ_EVENT_INFORMATION);
        compressPacket();
    }
}
